package com.example.handle;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: John
 * @Date 2019/5/7 11:43
 */
/*@RestController
@RequestMapping("/Shiro")
public class ShiroHandler {

    @PostMapping("/login")
    public ModelAndView login(@RequestParam("id") String id,@RequestParam("password") String password){
        ModelAndView mav = new ModelAndView("student/index");
        Subject subject = SecurityUtils.getSubject();
        if(!subject.isAuthenticated()){
            UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(id,password);
            try {
                subject.login(usernamePasswordToken);
            }catch (AuthenticationException e){
                e.getMessage();
            }
        }
        return mav;
    }

}*/
